home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
util
/
misc
/
ultimatepatchs.lha
/
UPS
/
Sources
/
AllocMem.s
next >
Wrap
Text File
|
1995-09-25
|
3KB
|
149 lines
;TOSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
incdir "include:"
include "exec/exec.i"
include "libs/exec.i"
incdir "ups:"
include "ups.i"
Start moveq #0,d0
rts
.end ds.b 32+Start-.end
dc.l pfsControlLong
dc.l 0 ; pointer to next patcher
dc.l 0 ; pointer to prev patcher
dc.l UPSMainVersion ; minimum version of UPS to start
dc.l UPSMainVersion ; version of UPS which was used
; while patcher was developed
dc.l PatcherName ; pointer to name of patcher
dc.w 39,0 ; version
dc.l CoderName ; pointer to name of programmer
dc.l VerString ; pointer to $VER: string
dc.l PatcherIDString ; listview entry
dc.l pfsDisableable ; flags
dc.l 0 ; status of flags
execbase
dc.l 0 ; exec base
intbase dc.l 0 ; intuition base
gadtbase
dc.l 0 ; gadtools base
dosbase dc.l 0 ; dos base
gfxbase dc.l 0 ; graphics base
cxbase dc.l 0 ; commodities base
laybase dc.l 0 ; layers base
upsbase dc.l 0 ; UPS lib base
dc.l 0 ; pointer to init routine
dc.l 0 ; pointer to exit routine
dc.l 0 ; pointer to prefs routine
dc.l 0 ; pointer to cx keys to call prefs rout
dc.l Resources ; pointer to structure of requested
; opened resources
dc.l Patch1 ; pointer to structure for patches
dc.l pls1 ; pointer to pls structure
dc.l 0 ; pointer to main UPS msg port
dc.l 0 ; pointer to rexx port
dc.l 0 ; pointer to pxs structure
dc.l 0,0,0
dc.l pfsControlLong
dc.l Start ; pointer to the beginning of struct
PatcherName
dc.b 'AllocMem() patcher',0
even
CoderName
dc.b 'Goran Mitrovic',0
even
VerString
dc.b '$VER: AllocMem patcher V1.0',0
even
PatcherIDString
dc.b 'Memory Defrag',0 ; 25
even
Resources
dc.l 0 ; pointer to next entry
dc.l 0 ; pointer to previous entry
dc.l rt_Library ; type of resource
dc.l 100 ; resource id
dc.l 0 ; flags
dc.l res1name ; pointer to name of resource
res1base
dc.l 0 ; base of opened resource
dc.l 36 ; version, if needed
ds.l 8 ; ...to put in data regs
dc.l 0 ; user open rout for user type
dc.l 0 ; user close rout for user type
dc.l 0 ; pointer to name for user type
dc.l 0,0
res1name
dc.b 'exec.library',0
cnop 0,4
Patch1
dc.l 0 ; pointer to next patch
dc.l 0 ; pointer to prev patch
dc.l 100 ; priority, less runs first
dc.l Start ; pointer to parent Patcher
dc.l Patch1ID ; listview entry
dc.l Patch1purpose ; pointer to purpose string
dc.l 100 ; id of resource to be patched
dc.l mpsDisableable ; flags
dc.l 0 ; status of flags
dc.l AllocMem ; offset to change
dc.l alloc ; pointer to new routine
dc.l 0 ; pointer to old routine
dc.l 0 ; pointer to pns structure
dc.l 0 ; notified when enabled/disabled
dc.l 0 ; install rout for user type
dc.l 0 ; uninstall rout for user type
dc.l 0 ; pointer to init routine
dc.l 0 ; pointer to exit routine
dc.l pls1 ; pointer to pls structure
dc.l 0,0,0,0
Patch1ID
dc.b 'AllocMem()',0 ; 27
even
Patch1purpose
dc.b 'improving',0 ; 16
cnop 0,4
pls1 dc.l 0 ; pointer to next link
dc.l 0 ; pointer to prev link
dc.l pls1ID ; listview string
dc.l 0 ; pointer to prefs routine
dc.l plsDisableable ; flags
dc.l 0 ; status
dc.l Patch1
dc.l 0
pls1ID dc.b 'AllocMem()',0 ; 27
cnop 0,4
alloc and.l #$ffffffff-MEMF_REVERSE,d1
cmp.l #1024,d0
bgt.s .exit
tst.l flip
bne.s .yes
move.l #-1,flip
bra.s .exit
.yes move.l #0,flip
or.l #MEMF_REVERSE,d1
.exit rts
flip dc.l 0